﻿<UserControl x:Class="SGGWElevator.ElevatorDoorPanel"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             Width="200" Height="40">
    <UserControl.Resources>

        <!--Brushes-->
        <SolidColorBrush x:Key="ControlBackgroundColor" Color="#2d2d30"/>
        <SolidColorBrush x:Key="ButtonDefaultBackgroundColor" Color="#333337" />
        <SolidColorBrush x:Key="ButtonHoverBackgroundColor" Color="#3e3e42" />

        <!--OpenButton-->
        <Style x:Key="OpenButtonStyle" TargetType="{x:Type Button}">
            <Setter Property="Background" Value="{StaticResource ButtonDefaultBackgroundColor}"/>
            <Setter Property="BorderThickness" Value="0" />

            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid Width="80" Height="30">
                            <Rectangle
                                x:Name="ControlBorder"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Stretch"
                                Fill="{StaticResource ButtonDefaultBackgroundColor}"
                                Stroke="{StaticResource ButtonDefaultBackgroundColor}"
                                StrokeThickness="3"/>
                            <ContentPresenter Content="{TemplateBinding Content}" />
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Rectangle.Stroke" TargetName="ControlBorder" 
      Value="{StaticResource ButtonHoverBackgroundColor}" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <Image Source="{Binding}"/>
                    </DataTemplate>
                </Setter.Value>
            </Setter>

        </Style>
    </UserControl.Resources>
    
    <!--Controls Content-->
    <Grid Background="{StaticResource ControlBackgroundColor}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Button x:Name="OpenButton" Style="{StaticResource OpenButtonStyle}" Grid.Column="0" Grid.Row="0" Click="OnOpenButtonClick">
            <Grid Width="60">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Image x:Name="LeftOpenButtonArrow" Source="/Images/ElevatorDoorPanel/arrowLeftOff.png" Stretch="None" Grid.Row="0" Grid.Column="0" />
                <Image x:Name="RightOpenButtonArrow" Source="/Images/ElevatorDoorPanel/arrowRightOff.png" Stretch="None" Grid.Row="0" Grid.Column="1" />
            </Grid>
        </Button>
        <Button x:Name="CloseButton" Style="{StaticResource OpenButtonStyle}" Grid.Column="1" Grid.Row="0" Click="OnCloseButtonClick">
            <Grid Width="60">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Image Name="LeftCloseButtonArrow" Source="/Images/ElevatorDoorPanel/arrowRightOff.png" Stretch="None" Grid.Row="0" Grid.Column="0"/>
                <Image Name="RightCloseButtonArrow" Source="/Images/ElevatorDoorPanel/arrowLeftOff.png" Stretch="None" Grid.Row="0" Grid.Column="1"/>
            </Grid>
        </Button>
    </Grid>
</UserControl>
